--
-- $Id: xpa-list-single.ads,v 1.3 2005-08-03 15:41:36 bacon Exp $
--

generic
	-- no generic parameters

package xpa.list.single is
	type node_access is private;
	type list is tagged private;

	procedure finalize (object: in out list);

	function size (object: in list) return natural;
	procedure clear (object: in out list);

	procedure prepend (object: in out list; datum: in datum_type);
	procedure append (object: in out list; datum: in datum_type);

	function first (object: in list) return node_access;
	function last (object: in list) return node_access;

	function is_valid (node_pointer: in node_access) return boolean;
	function forward (node_pointer: in node_access) return node_access;
	function value (node_pointer: in node_access) return datum_type;

private
	type node;
	type node_access is access node;

	type node is 
	record
		datum: datum_type;		
		next: node_access := null;
	end record;

	type list is new list_base with
	record
		head: node_access := null;
		tail: node_access := null;
		size: natural := 0;
	end record;

end xpa.list.single;
